//
//  CommentCell.m
//  JZRJAPP
//
//  Created by mac on 16/6/1.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "CommentsCell.h"
#import "DateTransform.h"
@implementation CommentsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setModel:(CommentModel *)model{
    _model = model;
    
    [self.headView sd_setImageWithURL:[NSURL URLWithString:model.HeadPicSrc]];
    
    NSUserDefaults *accountDefaults = [NSUserDefaults standardUserDefaults];
    //NSLog(@"获取的token值为%@",[accountDefaults objectForKey:@"Token"]);
    //NSLog(@"获取的电话号码是:%@",[accountDefaults objectForKey:@"phone"]);
    self.phoneLabel.text =[accountDefaults objectForKey:@"phone"];
    self.contentLabel.text = model.Content;
    
    
    
    NSString *dateStr = [NSString stringWithFormat:@"%@",model.Time];
    NSLog(@"%@",dateStr);
    
    NSString *str  = [dateStr substringWithRange:NSMakeRange(6, 10)];
    
    NSLog(@"日期格式%@",str);
    
    NSString *str2 = [DateTransform dateTransformTodate:str];
    
    self.dateLabel.text = str2;
    

}

@end
